home *** CD-ROM | disk | FTP | other *** search
- /* localtime.c Turbo C Bible Functions, p. 335 */
- #include <stdio.h>
- #include <time.h>
- main()
- {
- time_t tnow;
- struct tm *tmnow;
- time(&tnow);/* Get the time in seconds since 0 hrs GMT, 1/1/70
- * Convert it to string showing local time. Use the
- * environment variable TZ and the function "tzset"
- * to set tieh timezone appropriately.
- * Default time is PST. */
- tmnow = localtime(&tnow);
- printf("Local Time = %s\n", asctime(tmnow));
- }